#!/bin/bash
set -e

source $(dirname $0)/version

# The root of the harvester directory
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"

export PRELOADING_IMAGES="rancher/harvester-webhook:${TAG}"
export WEBHOOK_IMAGE_NAME="rancher/harvester-webhook:${TAG}"

echo "Running integration tests"
CGO_ENABLED=0 ginkgo -r -v -trace -tags=test \
        -ldflags "-X github.com/harvester/harvester/vendor/google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" \
	-failFast -slowSpecThreshold=120 -timeout=30m  "${ROOT_DIR}/tests/integration/..."
